<div id="pad-wrapper" class="new-user">
	<div class="row-fluid header">
		<h3>创建权限组</h3>
	</div>
	<div class="row-fluid form-wrapper">
		<!-- left column -->
		<div class="span9 with-sidebar">
			<div class="container">
				<form class="new_user_form form-horizontal" action="/sys/menu-save" method="post" id="dataForm" enctype="multipart/form-data">
					<div class="field-box"></div>
					<div class="control-group form-group span12">
						<label class="control-label" for="organization_name">菜单名称：</label>
						<div class="controls col-lg-5">
							<input type="text" class="form-control" id="name" name="name" placeholder="菜单名称"/>
						</div>
					</div>
					<div class="control-group form-group span12">
						<label class="control-label" for="organization_name">菜单url：</label>
						<div class="controls col-lg-5">
							<input type="text" class="form-control" id="url" name="url" placeholder="不显示为菜单可以不填写"/>
						</div>
					</div>
					<div class="control-group form-group span12">
						<label class="control-label" for="status">模块名称：</label>
						<div class="controls col-lg-5">
							<div class="ui-select span5">
								<select name="module_name">
									<option></option>
									<?php foreach ($actions as $action):?>
									<option value="<?php echo $action['controller'] . '|' . $action['action']?>"><?php echo $action['controller'] . '\\' . $action['action']?></option>
									<?php endforeach;?>
								</select>
							</div>
						</div>
					</div>
					<div class="control-group form-group span12">
						<label class="control-label" for="status">父级菜单：</label>
						<div class="controls col-lg-5">
							<div class="ui-select span5">
								<select name="parent_id">
									<?php if($row):?>
									<option value="<?php echo $row['id']?>"><?php echo $row['name']?></option>
									<?php else:?>
									<option value="0">顶级菜单</option>
									<?php foreach ($top_menu_list as $menu):?>
									<option value="<?php echo $menu['id']?>"><?php echo $menu['name']?></option>
									<?php endforeach;?>
									<?php endif;?>
								</select>
							</div>
						</div>
					</div>
					<div class="control-group form-group span12">
						<label class="control-label" for="status">是否作为菜单显示：</label>
						<div class="controls col-lg-5">
							<div class="ui-select span1">
								<select name="is_menu">
									<option value="1">是</option>
									<option value="0">否</option>
								</select>
							</div>
						</div>
					</div>
					<div class="control-group form-group span12">
						<label class="control-label" for="status">状态：</label>
						<div class="controls col-lg-5">
							<div class="ui-select span1">
								<select name="status">
									<option value="1">使用</option>
									<option value="2">禁用</option>
								</select>
							</div>
						</div>
					</div>
					<div class="span12 field-box"></div>
					<div class="control-group form-group span12 actions">
						<label class="control-label"></label>
						<div class="controls col-lg-5">
							<input type="submit" class="btn-glow primary" value="提交" />
						</div>
					</div>
				</form>
			</div>
		</div>
		<!-- side right column -->
		
		<div class="span3 form-sidebar pull-right">
		</div>
	</div>
	<script type="text/javascript">
	$(document).ready(function() {
		$('#dataForm').bootstrapValidator({
			message: 'This value is not valid',
			feedbackIcons: {
				valid: 'glyphicon glyphicon-ok',
				invalid: 'glyphicon glyphicon-remove',
				validating: 'glyphicon glyphicon-refresh'
			},
			fields: {
				name: {
					message: '菜单名称不符合规则',
					validators: {
						notEmpty: {
							message: '菜单名称是必填项，不能为空'
						}
					}
				},
				module_name: {
					message: '模块名称不符合规则',
					validators: {
						notEmpty: {
							message: '模块名称是必填项，不能为空'
						}
					}
				},
			}
		});
	});
	</script>
</div>